package com.aistar.service.impl;

import com.aistar.mapper.ProductReviewImagesMapper;
import com.aistar.mapper.ProductReviewMapper;
import com.aistar.pojo.ProductReview;
import com.aistar.pojo.ProductReviewImages;
import com.aistar.pojo.ProductReviewImagesExample;
import com.aistar.pojo.pojoOV.Review;
import com.aistar.service.ProductReviewImagesService;
import com.aistar.util.ServerResponse;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ProductReviewImagesServiceImpl implements ProductReviewImagesService {


    @Autowired
    private ProductReviewImagesMapper productReviewImagesMapper;


    @Override
    public ServerResponse add(ProductReviewImages productReviewImages) {
        return null;
    }

    @Override
    public ServerResponse modify(ProductReviewImages productReviewImages) {
        return null;
    }

    @Override
    public ServerResponse delete(Integer id) {
        return null;
    }

    @Override
    public ServerResponse getById(Integer id) {
        return null;
    }

    @Override
    public ServerResponse getByProductReviewId(Integer id) {
        ProductReviewImagesExample productReviewImagesExample = new ProductReviewImagesExample();
        productReviewImagesExample.createCriteria().andProductReviewIdEqualTo(id).andStatusEqualTo("1");
        List<ProductReviewImages> productReviewImages = productReviewImagesMapper.selectByExample(productReviewImagesExample);
        if(productReviewImages!= null && productReviewImages.size()>0)
            return ServerResponse.getSuccess( productReviewImages);
        return ServerResponse.getFailed("暂无数据");
    }

    @Override
    public ServerResponse getAll() {
        return null;
    }
}
